package gui;

import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JButton;

public class TestGUI extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public TestGUI(){
		setLayout(new FlowLayout(FlowLayout.LEFT,10,20));
		setLayout(new GridLayout(3,2,5,5));
		final JTextField tf1 = new JTextField("asdfsadgdfgfd",10);
		tf1.setSelectedTextColor(Color.cyan);
		tf1.setColumns(5);

		final JTextArea ta1 = new JTextArea(2,12);
		ta1.setLineWrap(true);
		JButton jb1 = new JButton("btn1");
		jb1.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				JOptionPane.showMessageDialog(null, tf1.getText(), "Message", JOptionPane.INFORMATION_MESSAGE);
			}
			
		});
		JButton jb2 = new JButton("btn2");
		
		add(tf1);
		add(ta1);
		add(jb1);
		add(jb2);
	}
	
	public static void main(String [] args){
		TestGUI gui = new TestGUI();
		gui.setVisible(true);
		gui.setSize(200,150);
		gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		gui.setTitle("GUI");
	}
	
	/*public class ButtonListener implements ActionListener{

		@Override
		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			JOptionPane.showMessageDialog(null, "TEXT", "Message", JOptionPane.INFORMATION_MESSAGE);
		}
		
	}*/
}
